
//api
export const apiCore = (url, options) => {
  const conifg = useRuntimeConfig();

  return useFetch(url, {
    baseURL: conifg.public.apiBase,
    ...options,
    onRequest({ options }) {
      let token  = localStorage.getItem("token");
      options.headers = {
        ...options.headers,
        Authorization: `Bearer ${token}`
      };
    }
  });
}